#include<bits/stdc++.h>
using namespace std;
namespace IO{
    const int BUF=1<<21;
    char buff[BUF],*p1=buff,*p2=buff;
    #define getchar() (p1==p2&&(p2=((p1=buff)+fread(buff,1,BUF,stdin)),p1==p2)?EOF:*p1++)
    template<typename T>inline void read(T &x){
        char ch=getchar();x=0;int f=1;
        while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
        while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
        x*=f;
    }
    char obuf[BUF],*p3=obuf;
    inline void pc(char ch){
        if(p3-obuf<BUF) *p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    inline void put(const int *s){while(*s) pc(*s),++s;}
    char ch[32],ctop;
    template<typename T>inline void print(T x){
    	if(x<0) x=~x+1,pc('-');
        if(!x) return pc(48);
        while(x) ch[++ctop]=x%10^48,x/=10;
        while(ctop) pc(ch[ctop--]);
    }
    inline void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
const int N=505;
const double inf=1e16;
int n,m;
struct node{int a,b;}a[N];
inline bool cmp(node x,node y){return x.b<y.b;}
inline bool cmp1(node x,node y){return x.a<y.a;}
double f[N][N],ans=inf;
inline void dp(const int K){
	for(int i=0;i<=m;++i)
	for(int j=0;j<=K;++j)
		f[i][j]=inf;
	f[0][0]=0;
	for(int i=1;i<=n;++i)
	for(int j=min(i,m);j&&j+n-i>=m;--j)
	for(int k=min(j,K);~k&&k+n-i>=K;--k)
		f[j][k]=min(f[j][k],min(f[j-1][k]+(double)a[i].a/(K+1),k?f[j-1][k-1]+(double)a[i].b/k:inf));
	ans=min(ans,f[m][K]);
}
int main(){
	freopen("talk.in","r",stdin);
	freopen("talk.out","w",stdout);
	read(n),read(m);
	bool sub=1;
	for(int i=1;i<=n;++i){
		read(a[i].a),read(a[i].b);
		if(a[i].b==-1) a[i].b=1e9;
		else sub=0;
	}
	if(sub){
		sort(a+1,a+n+1,cmp1);
		long long ans=0;
		for(int i=1;i<=m;++i) ans+=a[i].a;
		cout<<ans;
		return 0;
	}
	sort(a+1,a+n+1,cmp);
	for(int K=0;K<=m;++K) dp(K);
	printf("%.9lf\n",ans);
	return 0;
}


